﻿using System;
using System.Text;

namespace DecimalToBinary
{
    class DecimalToBinary
    {
        static string ConvertDecimalToBinary(int number)
        {
            StringBuilder bits = new StringBuilder();
            bool startCounting = false;
            for (int bitPosition = 31; bitPosition >= 0; bitPosition--)
            {
                byte bit = (byte)((number >> bitPosition) & 1);
                if (bit == 1)
                {
                    startCounting = true;
                }
                if (startCounting)
                {
                    bits.Append(bit);
                }
            }
            return bits.ToString();
        }

        static void Main()
        {
            Console.WriteLine(ConvertDecimalToBinary(6));
        }
    }
}